<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div onclick="getCode()"> getAuthCode </div>
	</body>
	<script>
	 function getCode(){
	 	var local = location.href; // 当前H5页面的url
	 	var appid = '2021001164607333';
	 	var wxUrl =
	 		'https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?app_id' +
	 		appid +
	 		'&redirect_uri=' +
	 		local +
	 		'&response_type=code' +
	 		'&scope=auth_base' +
	 		'&state=STATE';
	 	window.location.href = wxUrl;
	 	console.info(wxUrl)
	 }
	</script>
</html>
